<?php
/*
说明 : 该文件为判断访问的路径是否存在,不存在则跳到首页或者上一级目录
*/
include "../configs/global.php";
$error = array();
//跳转界面的类型
@$admin = $_GET['admin'] ? $_GET['admin'] : 0;
@$url = $_GET['url'] ? $_GET['url'] : 0;

if (!$url) { 
    $error['info'] = "您在点击了一个错误的按钮";
    $error['goback'] = 1;
    if (!$admin) {
        $error['url'] = "/" . WWWS . "/" . Home . "/index.php";
        $error['fh_info'] = "返回前台首页";
    } else {
        $error['url'] = "/" . WWWS . "/" . Admin . "/index.php";
        $error['fh_info'] = "返回后台首页";
    }

    include "erroer.html";
    exit;
}


$file = $_SERVER['DOCUMENT_ROOT'] . '/' . WWWS . '/' . $url;

if (!file_exists($file)) {
    $error = array();
    $error['info'] = "您正在打开外星球的网站";
    $error['goback'] = 1;
    $error['url'] = 0;
    $error['fh_info'] = "返回";

    include "404.html";
    exit;
}
echo "<script>location.href='/" . WWWS . "/" . $url . "'</script>";
